load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
load("//tools:defaults.bzl", "ts_project")

package(default_visibility = ["//visibility:public"])

ts_project(
    name = "cli",
    srcs = glob(
        ["**/*.ts"],
    ),
    deps = [
        "//packages/service-worker/config",
    ],
)

esbuild(
    name = "ngsw_config",
    config = "esbuild.config.js",
    entry_point = ":main.ts",
    external = [
        "@angular/service-worker",
    ],
    format = "esm",
    metafile = False,
    platform = "node",
    target = "node20",
    deps = [
        ":cli",
    ],
)
